﻿using System;

namespace Shuba.Model
{
    [Serializable]
    public class BranchInfo
    {
        public BranchInfo()
        {
        }

        public BranchInfo(string BranchID, string SourceCode, string BranchMapping, string BranchName, string PhoneNo, string EntryBy, DateTime EntryDate, string UpdateBy, DateTime UpdateDate)
        {
            this.BranchID = BranchID;
            this.SourceCode = SourceCode;
            this.BranchMapping = BranchMapping;
            this.BranchName = BranchName;
            this.PhoneNo = PhoneNo;
            this.EntryBy = EntryBy;
            this._EntryDate = EntryDate;
            this.UpdateBy = UpdateBy;
            this._UpdateDate = UpdateDate;
        }

        public BranchInfo(string BranchID, string SourceCode, string BranchMapping, string BranchName, string PhoneNo, string EntryBy, DateTime EntryDate, string UpdateBy, DateTime UpdateDate, string ActType)
        {
            this.BranchID = BranchID;
            this.SourceCode = SourceCode;
            this.BranchMapping = BranchMapping;
            this.BranchName = BranchName;
            this.PhoneNo = PhoneNo;
            this.EntryBy = EntryBy;
            this._EntryDate = EntryDate;
            this.UpdateBy = UpdateBy;
            this._UpdateDate = UpdateDate;
            this.ActType = ActType;
        }

        public string BranchID { get; set; }
        public string BranchName { get; set; }
        public string SourceCode { get; set; }
        public string BranchMapping { get; set; }
        public string PhoneNo { get; set; }
        public string EntryBy { get; set; }

        private DateTime _EntryDate = DateTime.Now;
        public DateTime EntryDate
        {
            get { return _EntryDate; }
            set { _EntryDate = value; }
        }
        public string UpdateBy { get; set; }
        private DateTime _UpdateDate = DateTime.Now;
        public DateTime UpdateDate
        {
            get { return _UpdateDate; }
            set { _UpdateDate = value; }
        }
        public string ActType { get; set; }

        public override string ToString()
        {
            return BranchID.ToString() + " - " + SourceCode + " - " + BranchMapping + " - " + BranchName + " - " + PhoneNo + " - " + 
                EntryBy + " - " + _EntryDate.ToString("yyyy MMM dd hh:mm:ss") + " - " + 
                UpdateBy + " - " + _UpdateDate.ToString("yyyy MMM dd hh:mm:ss");
        }

        public string ToString4Audit()
        {
            return "BRANCH NAME: " + BranchName + ", SOURCE CODE: " + SourceCode + ", BRANCH MAPPING: " + BranchMapping + ", PHONE NO: " + 
                PhoneNo + ", ENTRY_BY: " + EntryBy + ", ENTRY_DT: " + 
                _EntryDate.ToString("yyyy MMM dd hh:mm:ss") + ", UPDATE_BY: " + UpdateBy + ", UPDATE_DT: " + 
                _UpdateDate.ToString("yyyy MMM dd hh:mm:ss");
        }
    }
}
